using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using WpfAppPrismT1.ViewEvents;

namespace WpfAppPrismT1.ViewModels;

internal partial class Page1ViewModel : ObservableObject, INavigationAware
{
    [ObservableProperty]
    private string _message = "Page1ViewModel";

    public Page1ViewModel(IEventAggregator eventAggregator)
    {
        eventAggregator.GetEvent<MyBusinessEvent>().Subscribe(OnMyBusinessEvent);

        Message = DateTime.Now.ToString("HHmmss.fff");
    }

    private void OnMyBusinessEvent(MyBusinessEventPayload obj) { }

    public void OnNavigatedTo(NavigationContext navigationContext) { }

    public bool IsNavigationTarget(NavigationContext navigationContext)
    {
        return true;
    }

    public void OnNavigatedFrom(NavigationContext navigationContext) { }
}
